@extends('backend/layouts/default')
@section('title')
Chỉnh sửa danh mục từ điẻn
@stop
@section('content')
<h3 style="text-align: center"><span class="glyphicon glyphicon-pencil"></span> Chỉnh sửa danh mục từ điển</h3>
<form class="form-horizontal" action="" method="post" accept-charset="utf-8" role="form">
    {{ Form::token() }}
    <input type="hidden" name="data[Category][id]" value="<?= $data['category']->id ?>"/>

    <div class="row">
        <div class="col-md-9">
            <div class="form-group {{ $errors->has('title') ? 'error':'' }}">
                <label class="control-label col-sm-4" for="title">
                    Tiêu đề : * 
                </label>

                <div class="col-sm-8">
                    <input class="form-control" type="text" name="data[Category][title]" id="data[Category][title]" value="<?= $data['category']->title ?>"/>
                   
                    </script>
                </div>

            </div>  

            <div class="form-group">
                <label class="control-label col-sm-4">Danh mục cha </label>

                <div class="col-sm-8">

                    <?= Form::Select('data[Category][parent_id]', array('0' => 'Không thuộc danh mục nào') + $data['categories'], Input::old('data[Category][parent_id]', $data['category']['parent_id']), array('class' => 'form-control'))
                    ?>
                </div>
            </div> 
            <div class="form-group">
                <label class="control-label col-sm-4">Trạng thái </label>

                <div class="col-sm-8">

                    <?= Form::Select('data[Category][status]', $data['status'], Input::old('data[Category][status]', $data['category']['status']), array('class' => 'form-control'))
                    ?>
                </div>
            </div> 

            <div class="control-group" align="right">
                <div class="controls">
                    <a class="btn btn-link" href="{{ route('dictionaries/categories') }}">Hủy</a>
                    <button type="submit" class="btn btn-success">Lưu lại</button>
                </div>
            </div>
        </div>
    </div>
</form>
<link href="{{ asset('assets/commons/css/autocomplete.css')}}" rel="stylesheet"/>
<script type="text/javascript" src="{{ asset('assets/commons/js/jquery.mockjax.js')}}"></script>
<script type="text/javascript" src="{{ asset('assets/commons/js/jquery.autocomplete.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/commons/js/lyric.autocomplete.js') }}"></script>
<script src="{{asset('assets/commons/js/ckeditor/ckeditor.js')}}" type="text/javascript"></script>
<script type="text/javascript">
                        CKEDITOR.replace('textareabox', {toolbar: 'CusToolbar', height: '500px'});
</script>
@stop